package com.unit_9;

import java.util.Comparator;

public class Circle implements Comparable<Circle> {
    private double radius;
    public Circle(){
    }
    public Circle(double radius){
        this.radius = radius;
    }
    public double getPerimeter(){
        return 2 * radius * Math.PI;
    }
    public double getArea(){
        return Math.PI * radius * radius;
    }
    @Override
    public int compareTo(Circle circle) {
        return (int)(getArea() - circle.getArea());
    }
    public static void main(String[] args) {
        Circle[] circles = new Circle[] {new Circle(2),new Circle(3)};
        System.out.println(circles[0].getArea());
        System.out.println(circles[1].getArea());
        System.out.println(circles[0].compareTo(circles[1]));
    }
}
